package com.newland.rbac.utils;

import java.util.Random;

public class SaltUtil {
    public static String getSalt(int n){
        char[] charArray = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+".toCharArray();
        StringBuilder builder = new StringBuilder();
        for(int i=0;i<n;i++){
            builder.append(charArray[new Random().nextInt(charArray.length)]);
        }
        return builder.toString();
    }
}
